// pages/index/index.js
Page({
  data: {},
  showActionsheet: function() {
    wx.showActionSheet({
      itemList: ['图片识别', '数据管理', '数据面板', 'AI问答', '知识图谱'],
      success: function(res) {
        if (res.cancel) {
          console.log('用户点击取消');
        } else {
          const index = res.tapIndex;
          const pages = [
            '/pages/pictureRecognition/pictureRecognition',
            '/pages/dataManagement/dataManagement',
            '/pages/dataPanel/dataPanel',
            '/pages/aiQa/aiQa',
            '/pages/knowledgeGraph/knowledgeGraph'
          ];
          wx.navigateTo({
            url: pages[index]
          });
        }
      },
      fail: function(res) {
        console.log('显示操作菜单失败', res);
      }
    });
  }
});